package com.yonyou.crm.cum.contact.rmimpl;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.yonyou.crm.bpub.list.entity.AppListVO;
import com.yonyou.crm.common.page.entity.Page;
import com.yonyou.crm.cum.contact.entity.ContactVO;
import com.yonyou.crm.cum.contact.rmitf.IContactRmService;
import com.yonyou.crm.cum.contact.itf.IContactBizService;

@Service("contactService")
public class ContactRmServiceImpl implements IContactRmService {

	@Autowired
	private IContactBizService contactBizService;
	
	@Override
	public Page<ContactVO> getList(Page<ContactVO> page, Map<String, Object> paraMap) {
		return contactBizService.getList(page, paraMap);
	}
	
	@Override
	public ContactVO getDetail(Long id) {
		return contactBizService.getDetail(id);
	}
	
	@Override
	public ContactVO insert(ContactVO contact) {
		return contactBizService.save(contact);
	}
	
	@Override
	public ContactVO insert(ContactVO contact, Map<String, Object> param) {
		return contactBizService.save(contact, param);
	}

	@Override
	public ContactVO update(ContactVO contact) {
		return contactBizService.update(contact);
	}

	@Override
	public int delete(Long id) {
		return contactBizService.delete(id);
	}

	@Override
	public Page<ContactVO> batchDelete(String[] ids, Page<ContactVO> page, Map<String, Object> paraMap) {
		contactBizService.batchDelete(ids);
		return contactBizService.getList(page, paraMap);
	}
	
	@Override
    public List<AppListVO> getListForApp(Map<String, Object> map) {
    	return contactBizService.getListForApp(map);
    }
	
	@Override
	public int insertFollow(Long id) {
		return contactBizService.saveFollow(id);
	}

	@Override
	public int deleteFollow(Long id) {
		return contactBizService.deleteFollow(id);
	}
	
	@Override
	public List<String> getContactNameById(String[] ids){
		return contactBizService.getContactNameById(ids);
	}
}
